//spu接口
import request from '@/utils/request'

export default {
    //请求spu分页数据
getList(page, limit, category3Id){
    return request({
        url:`/admin/product/${page}/${limit}`,
        method: 'GET',
        params:{category3Id}
    })
    //return request.get(`/admin/product/${page}/${limit}`,category3Id)
    },
    //根据id获取spu详情
get(spuId){
    return request.get(`/admin/product/getSpuById/${spuId}`)
},
    //删除指定的spu
remove(spuId){
    return request.delete(`/admin/product/deleteSpu/${spuId}`)
},
//获取所有的销售属性列表
getSaleAttrList(){
    return request.get(`/admin/product/baseSaleAttrList`)
},
//添加（保存）spu
    addUpdate(spuInfo){
        return request.post(`/admin/product/${spuInfo.id?'update':'save'}SpuInfo`,spuInfo)
    }
}